; Music of Future Shock (1987) (Tynesoft) (Ian Waugh)
; Ripped by Megachur the 23/04/2009

; Need System Vectors

	write "FUTURESH.BIN"

music_date_rip	equ &1749
music_adr	equ &57fb
first_theme	equ 0
last_theme	equ 0	; 0 -> 0

	read "music_header_v1_0.asm"
;
.init_music
;
	ld hl,l592e
	ld (l5928),hl
	ld hl,l5a7e
	ld (l592b),hl
	xor a
	ld (l592a),a
	ld (l592d),a
	ld a,#06
	ld hl,l584f
	call #bcbc
	ld a,#06
	ld hl,l5859
	call #bcbf
	ld a,#07
	ld hl,l585f
	call #bcbc
	ld a,#07
	ld hl,l586c
	call #bcbf
	call l5876
	ld hl,l5846
	ld b,#81
	ld c,#00
	ld de,l5876
	call #bcd7
	ret
	ld hl,l5846
	call #bcdd
	ret
.l5846
	db #00,#00,#00,#00,#00,#00,#00,#00
.l584f equ $ + 1
	db #00,#03,#01,#0f,#01,#03,#ff,#04
.l5859 equ $ + 3
	db #0c,#ff,#08,#00,#00,#00,#00,#00
.l585f equ $ + 1
	db #00,#04,#03,#05,#01,#01,#00,#08
.l586c equ $ + 6
	db #01,#fe,#04,#0d,#ff,#08,#83,#01
	db #01,#03,#01,#fe,#03,#01,#01,#03
;
.play_music
.l5876
;
	push de
	push hl
	push bc
	push af
	push ix
	call l5889
	call l58cd
	pop ix
	pop af
	pop bc
	pop hl
	pop de
	ret
.l5889
	ld a,#01
	ld (l5916),a
	ld a,(l592a)
	and a
	jp nz,l589a
	ld a,#29
	ld (l5916),a
.l589a
	ld hl,(l5928)
	ld e,(hl)
	inc hl
	ld d,(hl)
	inc hl
	push hl
	ld (l5919),de
	ld de,#0010
	ld (l591d),de
	ld hl,l5916
	call #bcaa
	pop hl
	ret nc
	ld (l5928),hl
	ld a,(l592a)
	inc a
	cp #a8
	ld (l592a),a
	ret nz
	xor a
	ld (l592a),a
	ld hl,l592e
	ld (l5928),hl
	ret
.l58cd
	ld a,#04
	ld (l591f),a
	ld a,(l592d)
	and a
	jp nz,l58de
	ld a,#2c
	ld (l591f),a
.l58de
	ld hl,(l592b)
	ld e,(hl)
	inc hl
	ld d,(hl)
	inc hl
	ld c,(hl)
	inc hl
	ld b,(hl)
	inc hl
	push hl
	ld (l5922),de
	push bc
	pop hl
	add hl,hl
	add hl,hl
	add hl,hl
	ld (l5926),hl
	ld hl,l591f
	call #bcaa
	pop hl
	ret nc
	ld (l592b),hl
	ld a,(l592d)
	inc a
	cp #3c
	ld (l592d),a
	ret nz
	xor a
	ld (l592d),a
	ld hl,l5a7e
	ld (l592b),hl
	ret
.l591d equ $ + 7
.l5919 equ $ + 3
.l5916
	db #01,#06,#06,#00,#00,#00,#00,#00
.l5922 equ $ + 4
.l591f equ $ + 1
	db #00,#01,#07,#07,#00,#00,#00,#00
.l592d equ $ + 7
.l592b equ $ + 5
.l592a equ $ + 4
.l5928 equ $ + 2
.l5926
	db #00,#00,#00,#00,#00,#00,#00,#00
.l592e
	db #38,#02,#1c,#01,#1c,#01,#38,#02
	db #ef,#00,#ef,#00,#38,#02,#d5,#00
	db #d5,#00,#38,#02,#ef,#00,#38,#02
	db #fc,#00,#f6,#02,#38,#02,#1c,#01
	db #1c,#01,#38,#02,#ef,#00,#ef,#00
	db #38,#02,#d5,#00,#d5,#00,#38,#02
	db #ef,#00,#38,#02,#fc,#00,#7e,#02
	db #de,#01,#ef,#00,#ef,#00,#de,#01
	db #be,#00,#be,#00,#de,#01,#d5,#00
	db #d5,#00,#de,#01,#9f,#00,#de,#01
	db #be,#00,#7e,#02,#de,#01,#ef,#00
	db #ef,#00,#de,#01,#be,#00,#be,#00
	db #de,#01,#d5,#00,#d5,#00,#de,#01
	db #9f,#00,#de,#01,#be,#00,#f6,#02
	db #38,#02,#1c,#01,#1c,#01,#38,#02
	db #ef,#00,#ef,#00,#38,#02,#d5,#00
	db #d5,#00,#38,#02,#ef,#00,#38,#02
	db #fc,#00,#f6,#02,#38,#02,#1c,#01
	db #1c,#01,#38,#02,#ef,#00,#ef,#00
	db #38,#02,#d5,#00,#d5,#00,#38,#02
	db #ef,#00,#38,#02,#fc,#00,#7e,#02
	db #de,#01,#ef,#00,#ef,#00,#de,#01
	db #be,#00,#be,#00,#de,#01,#d5,#00
	db #d5,#00,#de,#01,#9f,#00,#de,#01
	db #be,#00,#7e,#02,#de,#01,#ef,#00
	db #ef,#00,#de,#01,#be,#00,#be,#00
	db #de,#01,#d5,#00,#d5,#00,#de,#01
	db #9f,#00,#de,#01,#be,#00,#f6,#02
	db #38,#02,#1c,#01,#1c,#01,#38,#02
	db #ef,#00,#ef,#00,#38,#02,#d5,#00
	db #d5,#00,#38,#02,#ef,#00,#38,#02
	db #fc,#00,#f6,#02,#38,#02,#1c,#01
	db #1c,#01,#38,#02,#ef,#00,#ef,#00
	db #38,#02,#d5,#00,#d5,#00,#38,#02
	db #ef,#00,#38,#02,#fc,#00,#7e,#02
	db #de,#01,#ef,#00,#ef,#00,#de,#01
	db #be,#00,#be,#00,#de,#01,#d5,#00
	db #d5,#00,#de,#01,#9f,#00,#de,#01
	db #be,#00,#7e,#02,#de,#01,#ef,#00
	db #ef,#00,#de,#01,#be,#00,#be,#00
	db #de,#01,#d5,#00,#d5,#00,#de,#01
	db #9f,#00,#de,#01,#be,#00,#f6,#02
.l5a7e
	db #8e,#00,#04,#00,#8e,#00,#02,#00
	db #7f,#00,#02,#00,#77,#00,#04,#00
	db #5f,#00,#10,#00,#77,#00,#04,#00
	db #77,#00,#02,#00,#6a,#00,#02,#00
	db #5f,#00,#04,#00,#50,#00,#10,#00
	db #8e,#00,#04,#00,#8e,#00,#02,#00
	db #7f,#00,#02,#00,#77,#00,#04,#00
	db #5f,#00,#10,#00,#77,#00,#04,#00
	db #77,#00,#02,#00,#6a,#00,#02,#00
	db #5f,#00,#04,#00,#50,#00,#10,#00
	db #47,#00,#04,#00,#47,#00,#02,#00
	db #3f,#00,#02,#00,#47,#00,#02,#00
	db #50,#00,#02,#00,#5f,#00,#02,#00
	db #6a,#00,#02,#00,#5f,#00,#04,#00
	db #5f,#00,#02,#00,#6a,#00,#02,#00
	db #5f,#00,#04,#00,#50,#00,#04,#00
	db #5f,#00,#04,#00,#5f,#00,#02,#00
	db #50,#00,#02,#00,#5f,#00,#02,#00
	db #6a,#00,#02,#00,#77,#00,#02,#00
	db #7f,#00,#02,#00,#8e,#00,#08,#00
	db #47,#00,#04,#00,#47,#00,#02,#00
	db #3f,#00,#02,#00,#47,#00,#02,#00
	db #50,#00,#02,#00,#5f,#00,#02,#00
	db #6a,#00,#02,#00,#5f,#00,#04,#00
	db #5f,#00,#02,#00,#6a,#00,#02,#00
	db #5f,#00,#04,#00,#50,#00,#04,#00
	db #5f,#00,#04,#00,#5f,#00,#02,#00
	db #50,#00,#02,#00,#5f,#00,#02,#00
	db #6a,#00,#02,#00,#77,#00,#02,#00
	db #7f,#00,#02,#00,#8e,#00,#24,#00
	db #00
;
.game_name
	db "Future Shock",0
.game_year
	db "1987",0
.game_publisher
	db "Tynesoft",0
.music_author
	db "Ian Waugh",0
.music_comment
	db "",0

	read "music_end_v1_0.asm"
